package com.nondo.rdp.finance.model.course;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.nondo.rdp.core.common.BeanUtils;
import com.nondo.rdp.core.model.AttachBean;
import com.nondo.rdp.finance.domain.course.Course;
import com.nondo.rdp.finance.domain.course.Section;

public class SectionQuery {
	private Long id; // 课节ID
	private String name; // 课节标题
	private String teacher; // 讲师
	private Date publishDate;// 发布时间
	private String duration; // 时长
	private AttachBean attach; // 音视频
	private AttachBean mainImg; // 视频截图
	private int sortNum;// 排序值
	private Integer playState = 0; // 播放状态

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getTeacher() {
		return teacher;
	}

	public void setTeacher(String teacher) {
		this.teacher = teacher;
	}

	@JsonFormat(pattern = "yyyy-MM-dd")
	public Date getPublishDate() {
		return publishDate;
	}

	public void setPublishDate(Date publishDate) {
		this.publishDate = publishDate;
	}

	public String getDuration() {
		return duration;
	}

	public void setDuration(String duration) {
		this.duration = duration;
	}

	public AttachBean getAttach() {
		return attach;
	}

	public void setAttach(AttachBean attach) {
		this.attach = attach;
	}

	public AttachBean getMainImg() {
		return mainImg;
	}

	public void setMainImg(AttachBean mainImg) {
		this.mainImg = mainImg;
	}

	public int getSortNum() {
		return sortNum;
	}

	public void setSortNum(int sortNum) {
		this.sortNum = sortNum;
	}

	public Integer getPlayState() {
		return playState;
	}

	public void setPlayState(Integer playState) {
		this.playState = playState;
	}

	public static SectionQuery covert2Bean(Section section) {
		SectionQuery sectionBean = new SectionQuery();
		BeanUtils.copy(section, sectionBean);
		Course course = section.getCourse();
		sectionBean.setTeacher(course.getTeacher());
		return sectionBean;
	}

}
